<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>会议详情 - 测盟汇系统</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <style>
        :root {
            --primary-color: #2c5545;
            --primary-light: #3a7d62;
            --primary-hover: #1e4636;
            --text-color: #333;
            --text-light: #555;
            --border-color: #d1d9d6;
            --bg-light: #f5f7f6;
            --bg-page: #e8ecea;
            --white: #fff;
            --shadow: 0 4px 24px rgba(44, 85, 69, 0.1);
            --radius: 12px;
            --transition: all 0.3s ease;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            background: var(--bg-page);
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            color: var(--text-color);
            line-height: 1.6;
        }

        .header {
            background: var(--primary-color);
            color: var(--white);
            padding: 1rem 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }

        .logo {
            display: flex;
            align-items: center;
        }

        .logo i {
            font-size: 1.8rem;
            margin-right: 0.8rem;
        }

        .logo h1 {
            font-size: 1.5rem;
            font-weight: 600;
        }

        .user-info {
            display: flex;
            align-items: center;
        }

        .user-info i {
            font-size: 1.2rem;
            margin-right: 0.5rem;
        }

        .logout-btn {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: var(--white);
            padding: 0.5rem 1rem;
            border-radius: 4px;
            cursor: pointer;
            transition: var(--transition);
            margin-left: 1rem;
            display: flex;
            align-items: center;
        }

        .logout-btn i {
            margin-right: 0.5rem;
        }

        .logout-btn:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        .container {
            max-width: 1200px;
            margin: 2rem auto;
            padding: 0 2rem;
        }

        .content-card {
            background: var(--white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            padding: 2rem;
            margin-bottom: 2rem;
            border: 1px solid var(--border-color);
            position: relative;
        }

        .content-card::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 6px;
            background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
            border-radius: var(--radius) var(--radius) 0 0;
        }

        .btn {
            padding: 0.8rem 1.5rem;
            border-radius: var(--radius);
            border: none;
            cursor: pointer;
            font-weight: 500;
            transition: var(--transition);
            display: inline-flex;
            align-items: center;
            text-decoration: none;
        }

        .btn i {
            margin-right: 0.5rem;
        }

        .btn-secondary {
            background: var(--bg-light);
            color: var(--text-color);
            border: 1px solid var(--border-color);
        }

        .btn-secondary:hover {
            background: #e1e8e4;
            transform: translateY(-2px);
        }

        .detail-header {
            border-bottom: 1px solid var(--border-color);
            padding-bottom: 1rem;
            margin-bottom: 1.5rem;
        }

        .detail-title {
            color: var(--primary-color);
            font-weight: 700;
            margin-bottom: 1.5rem;
            font-size: 1.8rem;
        }

        .meta-info {
            display: flex;
            flex-wrap: wrap;
            gap: 1.5rem;
            margin-bottom: 1.5rem;
            color: var(--text-light);
        }

        .meta-info span {
            font-weight: 600;
            display: flex;
            align-items: center;
        }

        .meta-info i {
            margin-right: 0.5rem;
            color: var(--primary-color);
        }

        .cover-image {
            max-width: 100%;
            height: auto;
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            margin: 1.5rem 0;
            transition: var(--transition);
            max-height: 400px;
            object-fit: cover;
        }

        .cover-image:hover {
            transform: scale(1.02);
        }

        .section-title {
            color: var(--primary-color);
            font-weight: 600;
            margin: 1.5rem 0 1rem;
            padding-bottom: 0.5rem;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            font-size: 1.3rem;
        }

        .section-title i {
            margin-right: 0.8rem;
        }

        .content-area {
            border: 1px solid var(--border-color);
            border-radius: var(--radius);
            padding: 1.5rem;
            margin-top: 1rem;
            background: var(--bg-light);
            line-height: 1.8;
        }

        .audit-card {
            background: var(--white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            padding: 2rem;
            margin-top: 2rem;
            border-left: 0.25rem solid var(--primary-color);
        }

        .audit-title {
            color: var(--primary-color);
            font-weight: 600;
            margin-bottom: 1.5rem;
            display: flex;
            align-items: center;
            font-size: 1.3rem;
        }

        .audit-title i {
            margin-right: 0.8rem;
        }

        .form-control {
            border-radius: var(--radius);
            padding: 0.75rem;
            border: 1px solid var(--border-color);
            background: var(--bg-light);
            transition: var(--transition);
            width: 100%;
            margin-bottom: 1rem;
        }

        .form-control:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 0.2rem rgba(44, 85, 69, 0.25);
            background: var(--white);
        }

        .btn-success {
            background: var(--primary-light);
            color: var(--white);
        }

        .btn-success:hover {
            background: var(--primary-hover);
            transform: translateY(-2px);
        }

        .btn-danger {
            background: #e74a3b;
            color: var(--white);
        }

        .btn-danger:hover {
            background: #c0392b;
            transform: translateY(-2px);
        }

        .status-tag {
            padding: 0.4rem 0.8rem;
            border-radius: 20px;
            font-size: 0.85rem;
            font-weight: 500;
            display: inline-flex;
            align-items: center;
        }

        .status-tag i {
            margin-right: 0.3rem;
            font-size: 0.8rem;
        }

        .status-pending {
            background: #fff3cd;
            color: #856404;
        }

        .status-published {
            background: #d4edda;
            color: #155724;
        }

        .status-rejected {
            background: #f8d7da;
            color: #721c24;
        }

        .action-buttons {
            display: flex;
            gap: 1rem;
            margin-top: 1.5rem;
        }

        .info-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 1.5rem;
            margin: 1.5rem 0;
        }

        .info-card {
            background: var(--bg-light);
            border-radius: var(--radius);
            padding: 1.5rem;
            border: 1px solid var(--border-color);
        }

        .info-card h4 {
            color: var(--primary-color);
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
        }

        .info-card h4 i {
            margin-right: 0.8rem;
        }

        .info-item {
            margin-bottom: 0.8rem;
            display: flex;
        }

        .info-label {
            font-weight: 600;
            min-width: 100px;
            color: var(--primary-color);
        }

        .info-value {
            flex: 1;
        }

        .meeting-id {
            background: var(--primary-color);
            color: white;
            padding: 0.25rem 0.75rem;
            border-radius: 20px;
            font-size: 0.9rem;
            font-weight: 500;
            display: inline-block;
            margin-left: 0.5rem;
        }

        @media (max-width: 768px) {
            .header {
                flex-direction: column;
                text-align: center;
                padding: 1rem;
            }

            .user-info {
                margin-top: 1rem;
            }

            .meta-info {
                flex-direction: column;
                gap: 0.8rem;
            }

            .action-buttons {
                flex-direction: column;
            }

            .info-grid {
                grid-template-columns: 1fr;
            }
        }
    </style>
</head>
<body>
<div class="header">
    <div class="logo">
        <i class="fas fa-store"></i>
        <h1>测盟汇系统</h1>
    </div>
    <div class="user-info">
        <i class="fas fa-user-shield"></i>
        <span>超级管理员：<span th:text="${session.user.username}"></span></span>
        <a th:href="@{/user/logout}" class="logout-btn">
            <i class="fas fa-sign-out-alt"></i>
            退出登录
        </a>
    </div>
</div>

<div id="app" class="container">
    <!-- 返回列表按钮 -->
    <a th:href="@{/admin/meeting/list}" class="btn btn-secondary">
        <i class="fas fa-arrow-left"></i>返回列表
    </a>

    <div class="content-card">
        <div class="detail-header">
            <h2 class="detail-title">会议详情</h2>
            <div class="meta-info">
                <span><i class="fas fa-calendar-alt"></i> 会议ID: <span th:text="${meeting.id}"></span></span>
                <span><i class="fas fa-clock"></i> 创建时间: <span th:text="${#dates.format(meeting.createTime, 'yyyy-MM-dd HH:mm')}"></span></span>
                <span>
                    <i class="fas fa-check-circle"></i> 审核状态:
                    <span th:if="${meeting.isApproved} == 0" class="status-tag status-pending"><i class="fas fa-hourglass-half"></i>待审核</span>
                    <span th:if="${meeting.isApproved} == 1" class="status-tag status-published"><i class="fas fa-check"></i>已通过</span>
                    <span th:if="${meeting.isApproved} == 2" class="status-tag status-rejected"><i class="fas fa-times"></i>已拒绝</span>
                </span>
            </div>
        </div>

        <h3 class="section-title"><i class="fas fa-info-circle"></i>基本信息</h3>
        <div class="info-grid">
            <div class="info-card">
                <h4><i class="fas fa-heading"></i>会议名称</h4>
                <div class="info-item">
                    <div class="info-value" th:text="${meeting.title}"></div>
                </div>
            </div>
            <div class="info-card">
                <h4><i class="fas fa-user"></i>创建人</h4>
                <div class="info-item">
                    <div class="info-value" th:text="${meeting.creator}"></div>
                </div>
            </div>
        </div>

        <div class="info-grid">
            <div class="info-card">
                <h4><i class="fas fa-clock"></i>开始时间</h4>
                <div class="info-item">
                    <div class="info-value" th:text="${#dates.format(meeting.startTime, 'yyyy-MM-dd HH:mm')}"></div>
                </div>
            </div>
            <div class="info-card">
                <h4><i class="fas fa-clock"></i>结束时间</h4>
                <div class="info-item">
                    <div class="info-value" th:text="${#dates.format(meeting.endTime, 'yyyy-MM-dd HH:mm')}"></div>
                </div>
            </div>
        </div>

        <h3 class="section-title"><i class="fas fa-file-alt"></i>会议内容</h3>
        <div class="content-area" th:text="${meeting.content}"></div>

        <h3 class="section-title"><i class="fas fa-image"></i>封面图片</h3>
        <div th:if="${meeting.coverImage}">
            <img th:src="${meeting.coverImage}" alt="会议封面" class="cover-image">
        </div>
        <div th:unless="${meeting.coverImage}">
            <p class="text-muted">暂无封面图片</p>
        </div>

        <div class="audit-card" th:if="${meeting.isApproved} == 0">
            <h3 class="audit-title"><i class="fas fa-gavel"></i>审核操作</h3>
            <textarea class="form-control" placeholder="请输入审核意见（可选）" rows="3"></textarea>
            <div class="action-buttons">
                <!-- 通过按钮 -->
                <a th:href="@{'/admin/meeting/approve/' + ${meeting.id} + '?status=1'}"
                   class="btn btn-success mr-2">
                    <i class="fas fa-check"></i>通过
                </a>

                <!-- 拒绝按钮 -->
                <a th:href="@{'/admin/meeting/approve/' + ${meeting.id} + '?status=2'}"
                   class="btn btn-danger">
                    <i class="fas fa-times"></i>拒绝
                </a>
            </div>
        </div>
    </div>
</div>

<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script>
<script>
    new Vue({
        el: '#app',
        data: {
            meetings: []
        },
        mounted() {
            console.log('会议详情页面加载完成');
        }
    });
</script>
</body>
</html>